package com.itheima.utils;

import javax.servlet.http.Cookie;

public class CookieUtils {
    public static Cookie findCookieByName(Cookie[] cookies, String cookieName) {
        if (cookies !=null){
            for (Cookie cookie : cookies) {
                if (cookieName.equals(cookie.getName())){
                    return cookie;
                }
            }
        }
        return null;
    }
}
